# -*- coding: utf-8 -*-

'''
Created on 09-06-05

@author: peterd
'''


import urllib

from infra.logging import logger


class DataProcessor:
	def match(self, data):
		return True
	
	def getUrl(self, data):
		log = logger.getLogger()
		
		try:
			data = urllib.quote_plus(data.encode('utf-8'), '/:?=;%+')
		except Exception, e:
			log.error('Failed to html escape url (left unchanged) reason: %s' % e)
			
		data = self.filter(data)			
			
		return self.do_getUrl(data)

	def filter(self, url):
		return url


	def do_getUrl(self, url):
		return url
